package org.lmind.example.common.web;

import org.springframework.beans.factory.FactoryBean;

public class ThreadLocalSessionContext implements FactoryBean<SessionContext> {
	
	private SessionContextManager sessionContextManager;
	
	public void setSessionContextManager(SessionContextManager sessionContextManager) {
		this.sessionContextManager = sessionContextManager;
	}

	@Override
	public SessionContext getObject() throws Exception {
		return sessionContextManager.getCurrentThread();
	}

	@Override
	public Class<?> getObjectType() {
		return SessionContext.class;
	}

	@Override
	public boolean isSingleton() {
		return true;
	}
}
